let  fs=require("fs")

// 写入文件操作：如果没有这个文件，则创建，默认是覆盖写
// fs.writeFile(文件路径,写入的内容 [,{flag:模式}] ,callback)  异步
// fs.writeFileSync(文件路径,写入的内容  [,{flag:模式}] )


// fs.writeFile("2.txt","hello",{flag:"a"},(err)=>{
//     console.log(err);
// })



fs.writeFileSync("3.txt","你好",{flag:"a"})
fs.writeFileSync("3.txt",'[1,2,3,4,5]',{flag:"a"})
fs.writeFileSync("3.txt",'{name:"zs"}',{flag:"a"})

// string  无论什么类型，都先转成字符串
// Buffer



// The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (12345)
